﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel.Channels;

namespace OnlineGameLibrary.MessageEx
{
    public class MessageDefine
    {
        public MessageVersion MessageVersion { set; get; }
        public string Namespace { set; get; }
        public string Action { set; get; }
        public Type BodyType { set; get; }
        public List<HeaderDefine> HeaderDefines { private set; get; }

        public bool IsMessageMatch(Message msg)
        {
            var action = msg.GetAction();
            if (action == this.Action)
                return true;
            else
                return false;
        }
        
        public MessageDefine(string ns, string action, Type bodytype)
        {
            Namespace = ns;
            Action = action;
            BodyType = bodytype;
            HeaderDefines = new List<HeaderDefine>();
            MessageVersion = MessageVersion.Soap12WSAddressing10;
        }
    }
}
